<extend name="Public:common" />
<block name="body">
  <div class="pure-u-11-13">
      <div class="index-content-top">     
            <div class="conten-issue">
                <div class="form-box">
                    <form action="__SELF__" method="post">
                        <select name="status">
                            <option value="">审核状态</option>
                            <option value="3">待审核</option>
                            <option value="1">审核通过</option>
                            <option value="2">审核未通过</option>
                            <option value="0">无审核信息</option>
                        </select>
                        <input type="text" name="username" />
                        <input type="submit" value="搜索"/>
                    </form>
                </div>
            </div>
        </div>
        <div class="zao"></div>
        <table border="1" cellspacing="" cellpadding="" class="index-content-table index-table-head" width="100%">
                <tr>
                  <td>ID</td>
                  <td>模特卡</td>
                  <td>用户名</td>
                  <td>注册时间</td>
                  <td>肖像权价格</td>
                  <td width="100">查看微博</td>
                  <if condition='$is_seller eq 0'><!--管理员-->
                    <td width="100">审核状态</td>
                    <td width="100">删除模特</td>
                    <td width="100">编辑模特</td>
                  </if>

                </tr>
            <volist name="list" id="vo">
               <tr>
                   <td>{$vo.id}</td>
                   <td><img src='__WWWROOT__{$vo.model_card|default="/Upload/images/modelcard/5486b0b784b97.jpg"}' alt='模特卡' width="100px" height="120px" /></td>
                   <td>{$vo.username}</td>
                   <td>{$vo.reg_time| date="Y-m-d H:i:s", ###}</td>
                   <td>{$vo.value}元/月</td>
                    <if condition='$is_seller eq 0'> <!-- 管理员 -->
                        <switch name='vo.status'>
                        <case value='0'>    <!-- 无认证信息 -->
                            <td><span class="index-amend" >暂无微博</span></td>
                            <td><span >无认证信息</span></td>
                        </case>
                        <case value='1'>    <!-- 审核通过 -->
                            <td><a href="{:U('Admin/Weibo/index',array('uid'=>$vo['id']))}" class="index-amend ">查看微博</a></td>
                            <td><span class="wcheck" name='$vo.id'>审核通过</span>
                                <!--模特审核内容显示-->
                                <div class="modal-wcheck">
                                    <h3>模特信息审核</h3>	
                                    <ul>
                                        <li><span>真实姓名：</span><p>{$vo.realname}</p></li>
                                        <li><span>联系邮箱：</span><p>{$vo.email}</p></li>
                                        <li> <span>证件号码：</span><p>{$vo.cardid}</p></li>
                                        <li><span>手机号码：</span><p>{$vo.mobile}</p></li>
                                    </ul>
                                    <div class="mobie-img">
                                        <img src="__WWWROOT__{$vo.card_img}" />
                                    </div>
                                    <div class="mobie-img2">
                                        <img src="__WWWROOT__{$vo.card_img}" />
                                    </div>
                                    <a class="checkyes" id="{$vo.id}"> 审核通过</a>  <a class="checkno" id="{$vo.id}"> 未通过审核</a>
                                </div>
                                <!--结束-->
                            </td>
                        </case>
                        <case value='2'>    <!-- 审核未通过 -->
                            <td><span class="index-amend" >暂无微博</span></td>
                            <td><span class="wcheck" name='$vo.id'>审核未通过</span>
                                <!--模特审核内容显示-->
                                <div class="modal-wcheck">
                                    <h3>模特信息审核</h3>	
                                    <ul>
                                        <li><span>真实姓名：</span><p>{$vo.realname}</p></li>
                                        <li><span>联系邮箱：</span><p>{$vo.email}</p></li>
                                        <li> <span>证件号码：</span><p>{$vo.cardid}</p></li>
                                        <li><span>手机号码：</span><p>{$vo.mobile}</p></li>
                                    </ul>
                                    <div class="mobie-img">
                                        <img src="__WWWROOT__{$vo.card_img}" />
                                    </div>
                                    <div class="mobie-img2">
                                        <img src="__WWWROOT__{$vo.card_img}" />
                                    </div>
                                    <a class="checkyes" id="{$vo.id}"> 审核通过</a>  <a class="checkno" id="{$vo.id}"> 未通过审核</a>
                                </div>
                                <!--结束-->
                            </td>
                        </case>
                        <case value='3'>    <!-- 待审核 -->
                            <td><span class="index-amend" >暂无微博</span></td>
                            <td><span class="wcheck">待审核</span>
                                <!--模特审核内容显示-->
                                <div class="modal-wcheck">
                                    <h3>模特信息审核</h3>	
                                    <ul>
                                        <li><span>真实姓名：</span><p>{$vo.realname}</p></li>
                                        <li><span>联系邮箱：</span><p>{$vo.email}</p></li>
                                        <li> <span>证件号码：</span><p>{$vo.cardid}</p></li>
                                        <li><span>手机号码：</span><p>{$vo.mobile}</p></li>
                                    </ul>
                                    <div class="mobie-img">
                                        <img src="__WWWROOT__{$vo.card_img}" />
                                    </div>
                                    <div class="mobie-img2">
                                        <img src="__WWWROOT__{$vo.card_img}" />
                                    </div>
                                    <a class="checkyes" id="{$vo.id}"> 审核通过</a>  <a class="checkno" id="{$vo.id}"> 未通过审核</a>
                                </div>
                                <!--结束-->
                            </td>
                        </case>
                        </switch>
                        <td><a href="{:U('Admin/Model/delModel',array('id'=>$vo['id']))}" class="index-amend ">删除模特</a></td>
                        <td><a href="{:U('Admin/Model/editModel',array('id'=>$vo['id']))}" class="index-amend ">编辑模特</a></td>
                    <else /> <!-- 卖家 -->
                        <if condition='$vo.status eq 1'>
                            <td><a href="{:U('Admin/Weibo/index',array('uid'=>$vo['id']))}" class="index-amend ">查看微博</a></td>
                        <else />
                            <td><span class="index-amend" >暂无微博</span></td>
                        </if>
                    </if>
               </tr>
            </volist>
        </table>
        <div class="index-paging">
            {$show_page}
        </div>
    </div>
</block>
<block name='script'>
    <script type="text/javascript">
        //审核模特
        $(function(){
            var hi = $(window).innerHeight();
            $(".zao").height(hi);
            $(".zao").click(function(){
                $(".modal-wcheck").hide();        		
                $(this).hide();        		
            });
            //单击审核查看审核信息
            $(".wcheck").live('click',function(){
                 $(this).parent('td').find(".modal-wcheck").show();
                 $(".zao").show();
            });

            $(".mobie-img").hover(function(){
            	$(this).next('.mobie-img2').show()
            	
            },function(){
            	
            	$(this).next('.mobie-img2').hide()
            	
            })
         
            //审核通过
            $('.checkyes').click(function(){
                var id = $(this).attr('id');
                var check = $(this).parents('td').find('.wcheck');
                $.post(
                    "{:U('Admin/Model/checkModel')}",
                    {uid:id, status:1},
                    function(data){
                        if(data.code == 1){                        
                            check.text('审核通过');
                            $(".modal-wcheck").hide();
                            $('.zao').hide();
                        }
                    }
                );
            });
            //审核未通过
            $('.checkno').click(function(){
                var id = $(this).attr('id');
                var check = $(this).parents('td').find('.wcheck');
                $.post(
                    "{:U('Admin/Model/checkModel')}",
                    {uid:id, status:2},
                    function(data){
                        if(data.code == 1){                        
                            check.text('审核未通过');
                            $(".modal-wcheck").hide();
                            $('.zao').hide();
                        }
                    }
                );
            });
        });
    </script>
</block>